<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page session="false"%>
<%@ page import="java.util.Calendar"%>
<%@ page import="java.util.*, java.text.*;"%>
<jsp:include page="/loginCheck.jsp" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=U">
<link rel="StyleSheet" href="css/jquery.qtip.min.css" type="text/css">
<link rel="StyleSheet" href="css/bootstrap.min.css" type="text/css">
<link rel="StyleSheet" href="css/messi.min.css" type="text/css">
<link rel="StyleSheet" href="css/style.css" type="text/css">

<script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="js/jquery.qtip.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/messi.min.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/checkform.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<title>注文新規入力</title>
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
<sb:head />
</head>
<body>
	<div class="wrapper">
		<tiles:insertTemplate template="/template/header.jsp"></tiles:insertTemplate>
		<div class="panel panel-success">
			<div class="panel-heading">
				<img src="img/newx.png" /><strong>注文新規入力</strong><img alt=""
					src="img/help.png" class="help-icon">
			</div>
			<div class="panel-body">
				<s:actionerror theme="bootstrap" />
				<s:actionmessage theme="bootstrap" />
				<s:fielderror theme="bootstrap" />
				<div class="container">
					<form action="register.action" class="form-horizontal" role="form"
						method="post" enctype="multipart/form-data"
						onsubmit="return validateSubmit(this);">
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-1 control-label">品名コード</label>
							<div class="col-sm-6">
								<input type="text" class="form-control" id="inputEmail3"
									name="productcode" style="height: 30px"
									value="<s:property value="productcode"/>" readonly="readonly">
								<input type="hidden" class="form-control" id="inputEmail3x"
									name="productgetcd" value="<s:property value="productgetcd"/>">
							</div>
						</div>
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-1 control-label">品名</label>
							<div class="col-sm-6">
								<input type="text" class="form-control" id="inputEmail3"
									name="productname" style="height: 30px;"
									value="<s:property value="productname"/>" readonly="readonly">
							</div>
						</div>
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-1 control-label">容量</label>
							<div class="col-sm-6">
								<select class="form-control capacity-choise"
									name="productcapacity">
									<option value=-1>選択してください。</option>
									<s:if test="listCapacity.size()>0">
										<s:iterator status="stat" value="listCapacity">
											<option value="<s:property value="formtype" />"
												weight="<s:property value="formweight" />"
												cd="<s:property value="formcd" />">
												<s:property value="formcd" /></option>
										</s:iterator>
									</s:if>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-1 control-label">数量</label>
							<div class="col-sm-6">
								<input type="text"
									class="form-control input_quantity input_check"
									id="inputEmail3" name="productquantity" style="height: 30px;"
									value=0>
							</div>
							<!-- 	<button type="button"
								class="col-sm-1 btn btn-info quantity-check bt-check">チェック</button>
								 -->
						</div>
						<div class="form-group">
							<label for="inputEmail4" class="col-sm-1 control-label">重量</label>
							<div class="col-sm-6">
								<input type="text" class="form-control input_weight input_check"
									id="inputEmail4" name="productweight" style="height: 30px;"
									value=0>
							</div>
							<!-- 
							<button type="button"
								class="col-sm-1 btn btn-info weight-check bt-check">チェック</button>
								 -->
						</div>
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-1 control-label">配達希望日</label>
							<%!DateFormat tipe = new SimpleDateFormat("");
	Calendar cal = Calendar.getInstance();%>
							<div class="col-sm-6">
								<div class="col-sm-4 select-f" style="padding-left: 0px;">
									<div class="input-group">
										<select class="form-control" name="productexpect_year">
											<option value=<%out.print(cal.get(Calendar.YEAR));%>>
												<%
													out.print(cal.get(Calendar.YEAR));
												%>
											</option>
											<option value=<%out.print(cal.get(Calendar.YEAR) - 1);%>>
												<%
													out.print(cal.get(Calendar.YEAR) - 1);
												%>
											</option>
										</select> <span class="input-group-addon">年</span>
									</div>
								</div>
								<div class="col-sm-4">
									<div class="input-group">
										<select class="form-control" name="productexpect_month">
											<%
												for (int i = 1; i < 13; i++) {
													int month = cal.get(Calendar.MONTH) + 1;
													if (i == month) {
											%>
											<option selected="selected" value=<%out.print(month);%>>
												<%
													out.print(month);
												%>
											</option>
											<%
												} else {
											%>
											<option value=<%out.print(i);%>>
												<%
													out.print(i);
												%>
											</option>
											<%
												}
												}
											%>
										</select> <span class="input-group-addon">月</span>
									</div>
								</div>
								<div class="col-sm-4">
									<div class="input-group">
										<select class="form-control" name="productexpect_day">
											<%
												for (int i = 1; i <= 31; i++) {
													int date = cal.get(Calendar.DATE);
													if (i == date) {
											%>
											<option selected="selected" value=<%out.print(date);%>>
												<%
													out.print(date);
												%>
											</option>
											<%
												} else {
											%>
											<option value=<%out.print(i);%>>
												<%
													out.print(i);
												%>
											</option>
											<%
												}
												}
											%>
										</select> <span class="input-group-addon">日</span>
									</div>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-1 control-label">分場</label>
							<div class="col-sm-6">
								<select class="form-control form-jichiku" name="jichikucd">
									<option value="-1" selected="selected">選択してください。</option>
									<s:iterator status="stats" value="listJichiku">
										<option value="<s:property value="jichikucd" />">
											<s:property value="jichikuname" /></option>
									</s:iterator>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-1 control-label">自由コメント</label>
							<div class="col-sm-6">
								<textarea class="form-control" rows="3" name="productcomment"></textarea>
							</div>
						</div>
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-1 control-label"></label>
							<div class="col-sm-6">
								<input type="hidden" name="farmcd"
									value="<s:property value="farmcd" />"> <input
									type="hidden" name="prefcd"
									value="<s:property value="prefcd" />"> <input
									type="hidden" name="actionType"
									value="<s:property value="actionType" />"> <input
									type="hidden" class="hd_seqno" name="seqno"
									value="<s:property value="seqno" />">
								<button type="submit" class="btn btn-primary btn-xs">新規入力</button>
								<button type="reset" class="btn btn-default btn-xs">リセット</button>
								<button type="button" class="btn btn-default btn-xs btn-cancel">キャンセル</button>
							</div>
						</div>
					</form>
				</div>
			</div>

			<tiles:insertTemplate template="/template/footer.jsp"></tiles:insertTemplate>
		</div>
	</div>
</body>
</html>